<template>
  <div>
    <div class="mar-t-15">
      <div class="list-header font-14 font-w flex">
        <span>
          <el-checkbox label="全选" size="large" class="font-w font-14" style="color: #323233" />
        </span>
        <span>商品</span>
        <span>规格</span>
        <span>购买数</span>
        <span>已发/未发</span>
        <span>退货数量</span>
      </div>
      <div v-for="(item, index) of 1" :key="index" class="mar-t-10">
        <div class="goods-info pad-t-13 pad-b-20 flex">
          <div class="v-align-c">
            <div>
              <el-checkbox label="" size="large" />
            </div>
            <div class="flex pad-l-10">
              <img class="width-80 height-80" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic153.nipic.com%2Ffile%2F20180116%2F8737320_170317603036_2.jpg&refer=http%3A%2F%2Fpic153.nipic.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1646876869&t=735c4dec0d8b574f5a0b36b9c548c37d" alt="">
              <div class="flex-col mar-l-10">
                <span class="font-12 font-color-3 line-1 goods-title">{{refundInfo.goodsTitle}}</span>
                <span class="font-12 font-color-6 mar-t-4">{{refundInfo.goodsCode}}</span>
                <span class="font-12 font-color-6">单价：<span class="count">￥{{refundInfo.goodsPrice}}</span></span>
              </div>
            </div>
          </div>
          <div>
            <span class="font-12 font-color-6">{{refundInfo.skuDetail}}</span>
          </div>
          <div>
            <span class="font-12 font-color-6">{{refundInfo.goodsNum}}</span>
          </div>
          <div>
            <span class="font-14 font-color-3">{{refundInfo.deliveryNum}}/{{refundInfo.goodsNum - refundInfo.deliveryNum}}</span>
          </div>
          <div class="flex-col">
            <el-input-number v-model="num" :min="1" :max="refundInfo.goodsNum" @change="handleChange" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import event from '@/model/event'

export default defineComponent({
  name: '',
  components: {
  },
  props: {
    refundInfo: {
      type: Object
    }
  },
  setup() {
    const num = ref(1)
    const handleChange = (value: number) => {
      event.emit('aftersale_refundGoodsNum', value)
    }
    return {
      num,
      handleChange
    }
  }
})
</script>

<style lang="scss" scoped>
  $darkBlue: #182245;
  $fontcolor: #323233;
  $td1-1: 116px;
  $td2: 245px;
  $td3: 149px;
  $td4: 228px;
  $td5: 193px;
  $td6: 144px;
  .list-header {
    width: 1140px;
    height: 48px;
    background: #F9F9F9;
    border: 1px solid #F5F5F5;
    color: $fontcolor;
    &>span {
      display: flex;
      align-items: center;
    }
    &>span:nth-child(1) {
      padding-left: 10px;
      width: $td1-1;
    }
    &>span:nth-child(2) {
      width: $td2;
    }
    &>span:nth-child(3) {
      width: $td3;
    }
    &>span:nth-child(4) {
      width: $td4;
    }
    &>span:nth-child(5) {
      width: $td5;
    }
  }
  .goods-info {
    &>div:not(:first-child) {
      margin-top: 7px;
    }
    &>div:nth-child(1) {
      padding-left: 10px;
      width: $td2 + $td1-1;
    }
    &>div:nth-child(2) {
      width: $td3;
    }
    &>div:nth-child(3) {
      width: $td4;
    }
    &>div:nth-child(4) {
      width: $td5;
    }
    &>div:nth-child(5) {
      width: $td6;
    }
    .goods-title {
      width: 189px
    }
    .count {
      color: #FF452C;
    }
  }
</style>

